package com.atguigu.srb.core.controller.admin;


import com.atguigu.common.result.R;
import com.atguigu.srb.core.pojo.entity.Lend;
import com.atguigu.srb.core.service.LendService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 标的准备表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-09-13
 */
@RestController
@RequestMapping("/admin/core/lend")
public class AdminLendController {

    @Resource
    LendService lendService;

    @GetMapping("/getList")
    public R getList(){
       List<Lend> list = lendService.getList();
       return R.ok().data("list",list);
    }
    @GetMapping("/show/{id}")
    public R showLend(@PathVariable Long id){
       Map<String,Object> lendDetail= lendService.showLend(id);
        return R.ok().data("lendDetail",lendDetail);
    }
}

